<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Regional,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="sun.reflect.generics.tree.IntSignature"%>
<%@page import="com.ejoysoft.common.Format"%>
<%@ include file="../include/jsp/head.jsp"%>

<%
	if(!globa.userSession.hasRight("10050"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
	//初始化
    Regional  task0=null;
    Regional obj=new Regional(globa);
    //查询条件
	String tWhere=" WHERE 1=1";
	tWhere += " ORDER BY strtaskid";
	
	//记录总数
	int intAllCount=obj.getCount(tWhere);
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = "10";
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集
	Vector<Regional> vctObj=obj.list(tWhere,intStartNum,intPageSize);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'regional_coverage.jsp' starting page</title>
    <style type="text/css">
	body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
	#l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
	#r-result{height:100%;width:20%;float:left;}
	</style>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="../css/main.css" rel="stylesheet" type="text/css" />
	<script language="JavaScript" src="../include/date/popc.js"></script>
	<script src="../include/js/list.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">
	var image2 = new BMap.Icon('../images/jxwd.jpg', new BMap.Size(40, 50), {
	offset: new BMap.Size(10, 25), // 指定定位位置
	imageOffset: new BMap.Size(0, 0 ) // 设置图片偏移
	});

	function show(){
		var strLongitude = new Array();
		var strLatitude  = new Array();
		strLongitude[0]=117.2;
		strLongitude[1]=117.21;
		strLongitude[2]=117.22;
		strLatitude[0]=31.8;
		strLatitude[1]=31.81;
		strLatitude[2]=31.82;
		
		if(vctObj!=null){
    	
        }
						
		var map = new BMap.Map("allmap");
		map.addControl(new BMap.NavigationControl());//鼠标平移缩放控件
		map.addControl(new BMap.OverviewMapControl());//右下角可视控件
		map.addControl(new BMap.MapTypeControl()); //地图类型控件
		map.enableScrollWheelZoom();// 启用滚轮放大缩小
		var markers = [];
			for(var i = 0; i < strLongitude.length;i++){
			var lat = strLongitude[i];
			var lot = strLatitude[i];
			//alert(lat+":"+lot);
			var point = new BMap.Point(lat, lot);//创建坐标点的位置
			//var  latlng3 = new BMap.LatLng(lat,lot);
			var marker = new BMap.Marker(point,{icon:image2});//标记坐标点
			map.centerAndZoom(point, 15);
			markers.push(marker);
			map.addOverlay(marker);//显示图标
			(function(){
				var index = i;
				markers[index].addEventListener('click', function(){
				this.openInfoWindow(new BMap.InfoWindow('我是第'+ (index +1) +'个标注'));
				}); 
			})();
		}
	}
	</script>
	

  </head>
  
  <body onload="show(); ">
	<div id="allmap"></div>
  </body>
</html>
